<?php
class LeaveModel extends Model{
//单表查询
	public function get_data(){
		return M('leave','','DB_MEETING')->select();
	}
//多表查询
	public function more_data(){
		return M('leave','','DB_MEETING')->join('leave_type on leave.leave_type = leave_type.type_id')->join('leave_prove on leave.leave_id = leave_prove.leave_id')->join('audience on leave.leave_uid = audience.audience_id')->field('leave.leave_id,leave.leave_uid,leave.leave_startTime,leave.leave_endTime,leave.leave_type,leave.leave_reason,leave.leave_state,leave_type.type_name,leave_type.type_prove,leave_prove.prove_image_path,audience.audience_name')->order('leave.leave_id desc')->select();
	}
//uid搜索
	public function audience_search($data){
		$like['audience_name'] = array('like',"%".$data."%");
		return M('audience','','DB_MEETING')->where($like)->field('audience_id,audience_name')->select();
	}

	
}


?>